function getMyDate(str){  
	var oDate = new Date(str),  
	oYear = oDate.getFullYear(),  
	oMonth = oDate.getMonth()+1,  
	oDay = oDate.getDate(),  
	oHour = oDate.getHours(),  
	oMin = oDate.getMinutes(),  
	oSen = oDate.getSeconds(),  
	oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间  
	return oTime;  
};  
function getzf(num){  
	if(parseInt(num) < 10){  
		num = '0'+num;  
	}  
	return num;  
} 
function secondToDate(msd) {
    var time = parseFloat(msd);
    if (null != time && "" != time) {
        if (time > 60 && time < 60 * 60) {
            time = parseInt(time / 60.0) + "分" + parseInt((parseFloat(time / 60.0) -
                parseInt(time / 60.0)) * 60) + "秒";
        }
        else if (time >= 60 * 60 && time < 60 * 60 * 24) {
            time = parseInt(time / 3600.0) + "时" + parseInt((parseFloat(time / 3600.0) -
                parseInt(time / 3600.0)) * 60) + "分" +
                parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
                parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
        }
        else {
            time = parseInt(time) + "秒";
        }
    }
    return time;
}
function MillisecondToDate(msd) {
    var time = parseFloat(msd)/1000;
    if (null != time && "" != time) {
        if (time > 60 && time < 60 * 60) {
            time = parseInt(time / 60.0) + "分" + parseInt((parseFloat(time / 60.0) -
                parseInt(time / 60.0)) * 60) + "秒";
        }
        else if (time >= 60 * 60 && time < 60 * 60 * 24) {
            time = parseInt(time / 3600.0) + "时" + parseInt((parseFloat(time / 3600.0) -
                parseInt(time / 3600.0)) * 60) + "分" +
                parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
                parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
        }
        else {
            time = parseInt(time) + "秒";
        }
    }
    return time;
}

function DateUtil(){};
DateUtil.YYYYMMDD="yyyyMMdd";
DateUtil.YYYY_MM_DD="yyyy-MM-dd";
DateUtil.YYYYMMDD_hh_mm_ss="yyyyMMdd hh:mm:ss";
DateUtil.YYYY_MM_DD_hh_mm_ss="yyyy-MM-dd hh:mm:ss";
DateUtil.YYYYMMDD_hhmmss="yyyyMMdd hhmmss";
DateUtil.YYYYMMDDhhmmss="yyyyMMddhhmmss";
DateUtil.ForChineseNoS="yyyy年MM月dd日 hh:mm";
DateUtil.ForChineseFullDateTime="yyyy年MM月dd日 hh:mm:ss";
DateUtil.format=function(date,_pattern){
	return date.format(_pattern);
};
DateUtil.format=function(timemillins,_pattern){
	return new Date(timemillins).format(_pattern);
};
DateUtil.now=function(pattern){
	if(pattern==''||pattern==undefined){
		return new Date().format(DateUtil.YYYY_MM_DD_hh_mm_ss);
	}else{
		return new Date().format(pattern);
	}
};
DateUtil.parse=function(datestr,pattern){
	return new Date(pattern.indexOf('yyyy')>-1?parseFloat(datestr.substr(pattern.indexOf('yyyy'),4)):1970,
			pattern.indexOf('MM')>-1?parseFloat(datestr.substr(pattern.indexOf('MM'),2))-1:0,
					pattern.indexOf('dd')>-1?parseFloat(datestr.substr(pattern.indexOf('dd'),2)):1,
							pattern.indexOf('hh')>-1?parseFloat(datestr.substr(pattern.indexOf('hh'),2)):0,
									pattern.indexOf('mm')>-1?parseFloat(datestr.substr(pattern.indexOf('mm'),2)):0,
											pattern.indexOf('ss')>-1?parseFloat(datestr.substr(pattern.indexOf('ss'),2)):0
	);
};
DateUtil.between=function(start,startPattern,end,endPattern){
	var startTime=DateUtil.parse(start,startPattern).getTime();
	var endTime=DateUtil.parse(end,endPattern).getTime();
	var days=-1;
	days=(endTime-startTime)/(24*60*60*1000);
	return days;
};
Date.prototype.format=function(fmt){
	var o = {
			"M+": this.getMonth() + 1, /*月份*/ 
			"d+": this.getDate(), /*日*/ 
			"h+": this.getHours(), /*小时 */
			"m+": this.getMinutes(), /*分*/ 
			"s+": this.getSeconds(), /*秒 */
			"q+": Math.floor((this.getMonth() + 3) / 3), /*季度*/ 
			"S": this.getMilliseconds() /*毫秒 */
	};
	if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	for (var k in o)
		if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	return fmt;
};